<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@page import="com.infomanage.enums.*" %>
<%@page import="com.qs.enums.*"%>
<%@page import="com.qs.enums.PeriodOption"%>
<%
	response.addDateHeader("Expires", 0);response.setHeader("Pragma","no-cache"); response.setHeader("Cache-Control","no-cache");
%>
 <%
 	com.infomanage.po.User user = (com.infomanage.po.User) request.getSession().getAttribute(com.infomanage.util.Consts.LOGINED_USER);
 %>   
<html>
<head>
<title>矿山救护远程调度管理指挥系统</title>
	<link href="<%=request.getContextPath()%>/css/style.css" rel="stylesheet" type="text/css">
	<link href="<%=request.getContextPath()%>/css/table.css" rel="stylesheet" type="text/css">
	<link href="<%=request.getContextPath()%>/css/calendar.css" rel="stylesheet" type="text/css">
	<script type="text/javascript" src="<%=request.getContextPath()%>/js/calendar.js"></script>
	<script type="text/javascript" src="<%=request.getContextPath()%>/js/common.js"></script>
	<script type="text/javascript">
		// 查询
	    function search() {
	    	form1.submit();
		}

		function showPersonTree(obj){
			var treeFrame = document.getElementById("treeFrame");
			treeFrame.style.display = "";
			var treeHeight = 200;
			var region = obj.getBoundingClientRect();
			var winWidth = document.body.clientWidth;
			var winHeight = document.body.clientHeight;
			var posX;
			var posY;
			if(treeHeight + region.bottom > winHeight && !isDown){
				posX = region.left;
				posY = region.top - treeHeight;
			}else {
				posX = region.left;
				posY = region.bottom;
			}
			treeFrame.style.left = posX;
			treeFrame.style.top = posY;
			treeFrame.style.width = obj.clientWidth;
			treeHeight = 250;
			treeFrame.style.height = treeHeight;
		}

		function onCheckboxClick(nodeObj){
			var existPerson = form1.traineeId.value;
			var existPersonName = form1.traineeName.value;
			var nodePersonName = nodeObj.nodeName;
			var nodePersonId = nodeObj.nodeId;
			var existPersonArray = existPerson.split(";");
			var existPersonNameArray = existPersonName.split(";");
			var isHasFlag = false;
			for(var i = 0; i < existPersonArray.length; i++){
	             if(existPersonArray[i] == nodePersonId){
	                 isHasFlag = true;
	                 break;
	             }
			}
			if(isHasFlag){
				existPersonArray.remove(i);
				existPersonNameArray.remove(i);
			}
			else{
	 			if(existPersonArray[0] == "" || typeof(existPersonArray[0]) == 'undefined'){
	 			   existPersonArray = new Array();
	 			   existPersonNameArray = new Array();
	 	 		 }
			     existPersonArray.push(nodePersonId);
			     existPersonNameArray.push(nodePersonName);
			}
			form1.traineeId.value = existPersonArray.join(";");
			form1.traineeName.value = existPersonNameArray.join(";");
			form1.traineeName.title = form1.traineeName.value;
		}
	</script>
</head>
<body rightmargin="0" bottommargin="0" leftmargin="0" topmargin="0" onclick="clickBody();" style="background: #ffffff;">
<form name="form1" id="form1" action="individual_data.jsp" target="dataFrame" method="post">
<table width="100%" height="100%"  border="0" align="center" cellpadding="0" cellspacing="0" style="table-layout: fixed;">
	<!-- 位置导航栏 -->
	<tr height="25px">
		<td width="100%" align="center" valign="top">
			 <table width="100%" border="0" cellpadding="0" cellspacing="0" class="tabtitle">
              <tr>
                <td width="4%" valign="top"><img src="<%=request.getContextPath()%>/img/pic_dot1.gif" width="37" height="22"></td>
                <td width="96%" valign="middle">当前位置：<a  class="n">质量标准化管理</a> &gt;&gt; <a  class="n">质量标准化训练管理</a>&gt;&gt; <a  class="n">训练成绩统计分析</a>&gt;&gt; <a  class="n">单项成绩趋势分析</a></td>
              </tr>
            </table>
		</td>
	</tr>
	<!-- 查询工具条 -->
	<tr>
		<td valign="top" height="70px">
			<fieldset style="height:100%; background-color: #d1e3ef;">
				<legend>查询</legend>
				<table cellpadding="0" cellspacing="0" style="padding-right: 5;" border="0">
		   					<tr>
		   						<td align="center" width="70px">队员</td>
		   						<td >
				   					<span class="treeSpan" onclick="showPersonTree(this);" treeSelect="true">
										<input name="traineeName" value="" style="width: 300px;" treeSelect="true" title=""><input name="traineeId" value="" type="hidden">
									</span>
		   						</td>
		   						<td align="center" width="70px">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;训练项目</td>
		   						<td width="300px">
		   							<select name="trainingSession">
										<%for(TrainingSession trainingSession : TrainingSession.getMembers()){ %>		   							
		   								<option value="<%=trainingSession.value()%>"><%=trainingSession.title() %></option>
		   								<%} %>
		   							</select>
		   					</tr>
		   					<tr>
		   						<td align="center" width="70px">从</td>
		   						<td width="300px">
		   							<input value= "" type="text" name="beginDate" style="width: 280px;cursor: hand;" id="beginDate" onClick="return showCalendar(this.id, 'y-mm-dd');" readonly="readonly"><img 
									src="<%=request.getContextPath() %>/img/tip_calender.gif" style="cursor: hand;" width="16" height="16" onClick="return showCalendar('beginDate', 'y-mm-dd');">
		   						</td>
		   						
		   						<td align="center" width="70px">到</td>
		   						<td width="300px">
		   							<input value= "" type="text" name="endDate" style="width: 280px;cursor: hand;" id="endDate" onClick="return showCalendar(this.id, 'y-mm-dd');" readonly="readonly"><img 
									src="<%=request.getContextPath() %>/img/tip_calender.gif" style="cursor: hand;" width="16" height="16" onClick="return showCalendar('endDate', 'y-mm-dd');">
		   						</td>
		   						<td  style="border-left: none;padding-left:20px;">
									<input name="Button12" type="button" class="button_cx" value="" title="查询" onclick="search();">
								</td>
		   					</tr>
		   		</table>
			</fieldset>
		</td>
   </tr>
   
   <!-- 空格 -->
   <tr height="3px">
		<td>
			&nbsp;
		</td>
   </tr>
   
   <!-- 数据列表 -->
   <tr>
	<td align="center">
		<iframe src="individual_data.jsp"  name="dataFrame" frameborder="0" width="98%" height="100%" scrolling="no"></iframe>
	</td>
   </tr>
</table>
<!-- 隐藏树 -->
<iframe src="<%=request.getContextPath()%>/infomanage/common/personSelectTree.jsp" frameborder="0" id="treeFrame" name="frame" style="display: none;position: absolute;"></iframe>
</form>

<!-- 批量删除表单  -->
<form action="apparatustest_action.jsp" name="delForm" target="actionFrame">
	<input type="hidden" value="delBatch" name="actionType">
	<input type="hidden" value="" name="batchIds">
</form>
</body>
</html>
